Storage system, storage device, and control method thereof

ABSTRACT

A storage system including a storage device which includes media for storing data from a host computer, a medium controller for controlling the media, a plurality of channel controllers for connecting to the host computer through a channel and a cache memory for temporarily storing data from the host computer, wherein the media have a restriction on a number of writing times. The storage device includes a bus for directly transferring data from the medium controller to the channel controller.

The present application is a continuation of application Ser. No.11/247,161, filed Oct. 12, 2005, now U.S. Pat. No. 7,464,221, whichclaims priority of Japanese patent applications No. 2005-252989 filed onSep. 1, 2005, the entire contents of which are hereby incorporated byreference.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to a storage device and the control methodthereof.

2. Description of the Related Art

In recent years, the reduction of the total cost of ownership (TCO) of astorage system becomes increasingly important in information businesssites such as a data center. On the other hand, demand for recordingdata reliably for a long period of time is increasing. As an example ofthis fact, the document data of financial institutions, medicalinstitutions, etc., are required to be stored without being erased bylaw. Under these circumstances, there is much demand for highly reliablestorage systems having a large capacity. However, in general, in alarge-scale storage system using hard-disk drives (in the following,referred to as “HDDs”), the amount of power consumption increases inproportion to the storage capacity. That is to say, the possession of astorage system with a large capacity means an increase in the total costof ownership including electricity charges. In view of such situations,a technique for reducing the power consumption of HDDs by a cachemanagement algorithm has been proposed (Nonpatent document; ZHU, Q.,DAVID, F., ZHOU, Y, DEVARAJ, C., AND CAO, P., “Reducing EnergyConsumption of Disk Storage Using Power-Aware Cache Management”.

InProc. of the 10th Intl. Symp. on High Performance ComputerArchitecture (HPCA-10) (Feb. 2004)). Also, the problem is not limited tothe electricity charges. In general, the floor area for installationincreases as the capacity of a storage system increases. This alsoincreases the total cost of ownership.

Incidentally, a flash memory attracts attention as a nonvolatile mediumin recent years. A flash memory commonly consumes less than oneseveral-tenth of power when compared with an HDD, and can be read at ahigh speed. Also, a flash memory is small sized unlike an HDD having amechanically driven part.

However, a flash memory has a restriction on the number of writing timesbecause of the physical constitution of a cell for holding information.Against such a restriction, the number of writing times of a flashmemory has been improved by a technique called wear leveling, in whichthe number of writing times to each cell is controlled to be averaged byhaving correspondence between an address to be shown to the upperapparatus and a cell position. In this regard, in the following, anelement for holding information is simply called a “flash memory”, and adevice including a mechanism for performing the above-described wearleveling, protocol processing for the upper apparatus, etc., is called a“flash memory device”. Although some improvements have been made againstthe restriction on the number of writing times as a flash memory deviceby such a technique, there still exists a restriction on the number ofwriting times of a flash memory device. Also, in addition to that, thereis a drawback in that the throughput of a flash memory becomes similarto an HDD when an operation called erase becomes necessary at the timeof writing to a flash memory.

As a technique for constituting a storage system using such a flashmemory, there is, for example, Japanese Unexamined Patent ApplicationPublication No. 6-324815. In this patent document, a technique in whichfrequently-accessed parity data is stored in a semiconductor memory suchas a flash memory in a RAID configuration, etc., in order to improveperformance of a storage system is described. However, means forpreventing a restriction on the number of writing times as a storagesystem has not been disclosed. Also, one RAID group is constructed bymixing an HDD and a flash memory, that is to say, one virtual device isconstituted, and thus a virtual device is not controlled inconsideration of the characteristics of individual media.

SUMMARY OF THE INVENTION

Under these circumstances, it is desirable to provide a storage systemwhich is low in power consumption, has a small installation area, and iscapable of constructing a large-scale system having a large capacity.

Also, it is desirable to provide a high system performance in accordancewith the medium for storing data.

Moreover, it is also desirable to improve reliability and availabilityas a storage system. For a medium having a restriction of the number ofwriting times, it is necessary to alleviate the restriction as a storagesystem.

In the present invention, a storage system includes a plurality ofchannel controllers connecting to a host computer through channels and acache memory containing a plurality of volatile memories for temporarilystoring data from the host computer. The storage system includes aplurality of first media having a restriction of the number of writingtimes and a plurality of first medium controllers for controlling thefirst media, and stores data from the host computer to the first media.

That is to say, according to the present invention, there is provided astorage system including a storage controller including: one medium ormore for storing data from a host computer; a medium controller forcontrolling the medium; a channel controller for connecting to the hostcomputer through a channel; and a cache memory including a volatilememory for temporarily storing data from the host computer, wherein themedia at least partially includes a first medium having a restriction ona number of writing times.

In the storage system of the present invention, the power consumption islow, the installation area is small, and it is possible to construct alarge-scale system. Also, it is possible to provide a high systemperformance in accordance with the medium for storing data. Also, thereis an advantage in that the number of writing times to each medium isreduced, and thus it is possible to increase the reliability and theavailability of the storage system even for the medium having arestriction on the number of writing times.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram of a configuration of a storage systemaccording to a first embodiment;

FIG. 2 is a block diagram of a detailed configuration of a channelcontroller 11;

FIG. 3 is a block diagram of a detailed configuration of an FM controlunit 16;

FIG. 4 is a block diagram of another detailed configuration of the FMcontrol unit 16;

FIG. 5 is a block diagram of another detailed configuration of the FMcontrol unit 16;

FIG. 6 is a block diagram of a detailed configuration of an internalswitch 12;

FIG. 7 is a diagram illustrating the processing flow when a read requestcomes from a host computer 2 to an HDD 50 area;

FIG. 8 is a diagram illustrating the processing flow when a read requestcomes from a host computer 2 to a flash memory area;

FIG. 9 is a block diagram illustrating detailed data stored in a cachememory 13 and a control memory 17;

FIG. 10A is a block diagram illustrating details of read-cache directoryinformation 1711 and write-cache directory information 1172;

FIG. 10B is a block diagram illustrating details of knownaccess-sequence lists 1713 and 1714;

FIG. 10C is a block diagram illustrating details of access-sequencelists 1713 and 1714 for performing preferable cache control;

FIG. 11A is a diagram illustrating the processing flow when a writerequest comes from the host computer 2 and there is already the data ofthe address in the cache memory 13;

FIG. 11B is a diagram illustrating the processing flow when a writerequest comes from the host computer 2 and there is not the data of theaddress in the cache memory 13 or there is already no empty slot;

FIG. 12A is a diagram illustrating the processing for determining a slotto be destaged;

FIG. 12B is a diagram illustrating the processing for determining a slotin consideration of not only the number of stages but also the number ofaccesses;

FIG. 13 is a block diagram of a storage system according to a secondembodiment; and

FIG. 14 is a block diagram of a highly-functional FM control unit 160.

DESCRIPTION OF THE PREFERRED EMBODIMENTS

A description will be given of a best mode of embodiment for carryingout the present invention.

In the following, a description will be given of a storage system, astorage device, and the control method thereof according to embodimentsof the present invention based on the drawings.

First Embodiment

A description will be given of a first embodiment. FIG. 1 is a blockdiagram of a configuration of a storage system according to the firstembodiment of the present invention. The storage system includes astorage controller 1, hard disk drives (HDDs) 50, and a flash memorydevice (in the figure, an example of an FM control unit 16 internallyincluding flash memory devices is shown). The storage controller 1 isconnected to a host computer 2 via a channel 4 through a SAN (StorageArea Network) including a SAN switch 3. Also, the storage controller 1is connected to a plurality of HDDs 50 which are media storing datathrough a disk-side channel 60. The storage controller 1 includes aplurality of channel controllers 11, a plurality of cache memories 13, acontrol memory 17, a plurality of disk controllers 14, a plurality of FMcontrol units 16, and internal switches 12 connecting these through aninternal bus 15. The channel controller 11 receives an input/outputrequest from the host computer 2 through the channel 4, interprets therequest type (for example, a read request and a write request) of thisinput/output request, the target address, etc., and performs theprocessing as described in FIG. 7 and below. The cache memoriestemporarily stores data to be stored in an HDD and a flash memory anddata to be returned to the host computer 2. The control memory 17 storesthe directory information of the cache memories 13 and the configurationinformation of the storage system. The disk controllers 14 control theHDDs 50 through a disk-side channel 60 based on a request of the channelcontroller 11, etc., and fetches and stores the data requested from thehost computer 2. At this time, the disk controllers 14 may perform RAIDcontrol on the HDDs 50 in order to improve the reliability,availability, and performance of the storage system. The FM controlunits 16 perform the control of flash memories or the flash memorydevices. The FM control units 16 fetch and store the data requested fromthe host computer 2 to the flash memories or the flash memory devicebased on a request of the channel controllers 11, etc. At this time, theFM control units 16 may perform RAID control on the flash memory devicesin order to improve the reliability, availability, and performance ofthe storage system. In this regard, in the present embodiment, thestorage system is connected to the HDDs 50.

However, the storage system may have a configuration without having theHDDs 50 and the disk controllers 14. Also, the information stored in thecontrol memory 17 may be physically located in the same memory as thecache memories 13.

FIG. 2 is a block diagram of the detailed configuration of the channelcontroller 11. The channel controller 11 includes a plurality ofprocessors 111, a memory module 112, a peripheral control unit 113, aplurality of channel protocol processors 114, and an internal networkinterface 117. The processors 111 are connected to the peripheralcontrol unit 113 through a bus, etc. The peripheral control unit 113 isconnected to the memory module 112 and controls the memory module. Also,the peripheral control unit 113 is connected to the channel protocolprocessors 114 and the internal network interface 117 through a controlsystem bus 115. The peripheral control unit 113 receives a packet fromthe connected processors 111, the channel protocol processors 114, andthe internal network interface 117. If the destination address indicatedby the packet falls on the memory module 112, the peripheral controlunit 113 performs the processing, and returns data if necessary. Also,if the destination address falls outside, the peripheral control unit113 performs appropriate forwarding. Also, the peripheral control unit113 has a mail box 1131 for the other processors 111 to performcommunication with the processor 111 connected to the peripheral controlunit 113. The processors 111 access the memory module 112 through theperipheral control unit 113, and performs processing based on thecontrol program 1121 stored in the memory module 112. Also, the memorymodule 112 stores a transfer list 1123 for the channel protocolprocessors 114 performing DMA (Direct Memory Access). The channelprotocol processor 114 performs protocol control on the channel 4, andconverts into a protocol which can be processed in the storage system 1.When the channel protocol processor 114 receives an input/output requestfrom the host computer 2 through the channel 4, the channel protocolprocessor 114 notifies the host computer number, the LUN (Logical UnitNumber), the access destination address of the input/output request,etc., to the processor 111. The processor 111 accesses directoryinformation 1323 based on the notification. If there is an address towhich the input/output data is to be stored or the input/output data,the processor 111 creates the transfer list 1123 in the memory module112, and causes the channel protocol processor 114 to perform transferbased on the list. When the data requested for reading by the hostcomputer 2 is not in the cache memory 13, if the data is stored in theHDD 50, the processor 111 instructs the disk controller 14 to store therequested data stored in the HDD 50 into the cache memory 13 (thisoperation is called “staging”), and then causes to transfer the data bythe transfer list 1123. If the data is stored in the flash memory, theaddress of the flash memory is set in the transfer list. The transferlist is an address list in the cache memory 13 or the flash memory. Ifthe input/output request is writing, the data from the host computer iswritten into the address described in the list through the internalnetwork interface 117 connected the data-transfer system bus 115. Also,if the request is reading, the data is similarly read from the addressdescribed in the list, and that data is returned to the host computer.The details of these operations are described using FIG. 7 andsubsequent figures. The internal network interface 117 is a part to bean interface when communication is performed between the inside of thechannel controller 11 and the inside of the other storage systems 1through an internal bus 15.

In this regard, the disk controller 14 has a substantially similarstructure to the channel controller 11. However, the contents of thecontrol program 1121 is different and the channel protocol processor 114performs communication with the HDD 50 (the protocol of the channel 4and that of the disk-side channel 60 may be different. However, theprocessing is the same as the channel protocol processors 114 in thechannel controller 11 in the sense that protocol processing of thedisk-side channel 60 is performed and the conversion is performed inorder to be processed in the storage system 1). The processor 111 writesthe data in the cache memory 13 into a hard disk drive 50 by a requestfrom the channel controller 11 or at regular time intervals. Also, ifthe data requested from the host computer is not in the cache memory 13,the processor 111 receives an instruction from the channel controller11, reads data from the HDD 50, and writes the data into the cachememory 13. At these times, the processor 111 accesses the directoryinformation stored in the control memory 17, and investigates theaddress of the cache memory from or to which the requested data by thehost computer 2 is read or stored. When there is not the requested datain the cache memory 13, if there is no empty area in the cache memory13, the existent data is stored into the HDD 50 for making an empty areain order to store the requested data (this operation is called destage).In the operation of the HDD 50, the disk controller 14 controls the HDD50 through the disk-side channel 60. At this time, in order to improvethe availability and the performance as the entire HDDs 50, the diskcontroller 14 performs the RAID control on the HDD 50 group.

FIG. 3 is a block diagram of the detailed configuration of the FMcontrol unit 16, in which flash memories are integrated. The FM controlunit 16 includes an internal network interface 161, a DMA controller162, a memory module 164 which is a volatile memory, a memory controller163 for controlling the memory module, flash memories 166 (FM in thefigure), FM controllers 165 which control the flash memories. Theinternal network interface 161 is a part to be an interface between theinside of the FM control unit 16 and the inside of the other storagecontroller 1 through the internal bus 15. The DMA controller 162 in theFM control unit 16 performs data transfer from the cache memory 13 tothe flash memory 166 using the transfer list 1641 set by the processor111 of the channel controller 11 in the case of creating an empty areain the cache memory when processing a write request from the hostcomputer 2. The FM controller 165 controls the flash memory 166 toexchange data by a read request made from the channel controller 11through the internal network and a write request of the DMA controller162. In FIG. 3, as an embodiment of the flash memory 166, it is possibleto directly dispose the memory on a printed-circuit board. At this time,parts such as the connectors, the FM protocol processors in FIG. 4, andFM-side channels become unnecessary, and thus it is possible to achievemore compact storage system. Also, the wear leveling for each of theflash memories 166 may be performed by the FM controller 165.

FIG. 4 is a block diagram of another detailed configuration of the FMcontrol unit 16. Here, a flash memory device 169 is used as a memoryelement. The flash memory device 169 is disposed separately. The flashmemory device 169 is connected to the FM control unit 16 through aconnector 168, and thus the flash memory device is made detachable.Accordingly, when the flash memory device 169 has broken down, it can bereplaced (in order to do this, the transfer list 1641 should be set suchthat the processor 111 of the channel controller 11 has a redundantconfiguration among the flash memory device 169 in advance). Also, it ispossible to replace the flash memory device 169 itself by a flash memorydevice having a large capacity. The reliability and performance of thisflash memory device 169 have been improved by employing a technique,such as wear leveling, etc., inside the device. Data is exchanged withthe outside using a special protocol. Thus, a FM protocol processor 167converts the data into a format that can be processed in the storagecontroller 1.

FIG. 5 is a block diagram of another detailed configuration of the FMcontrol unit 16. Here, the flash memory devices 169 are connectedthrough FM-side channels 1610. By using this configuration, a largernumber of flash memory devices 169 can be connected in order to achievea storage system with a large capacity in addition to the features ofthe FM control unit 16 described in FIG. 4. Also, part of the area ofthe flash memory devices 169 may be used as an urgent destage area 1690described below.

FIG. 6 is a block diagram of a detailed configuration of the internalswitch 12. The internal switch 12 includes an internal network interface121 and a plurality of selectors 122. The selector 122 analyzes thedestination of the request sent from each part such as the internalchannel controller 11 of the storage controller 1, and transfers therequest to the internal network interface 121 controlling the internalbus 15 connected to the request destination. At that time, each of theselectors performs the contention of the internal network interface 121of the request-transfer destination. The internal switch 12 makes itpossible for the channel controller 11 to directly exchange data withthe cache memory 13, the control memory 17, and the FM control unit 16.The FM control unit 16 can exchange data with the channel controller 11,the cache memory 13, and the control memory 17. Also, the diskcontroller 14 can directly exchange data with the cache memory 13 andthe control memory 17. The difference on the connection of the FMcontrol unit 16 and that of the disk controller 14 is that the internalswitch 12 has a connection 123 between the channel controller and the FMcontrol unit, and thus the FM control unit 16 can directly exchange datawith the channel controller 11.

FIG. 7 is a diagram illustrating the processing flow when a read requestcomes from the host computer 2 to an HDD 50 area. The channel controller11 receives a read request from the host computer 2 through the channel4 (step s701). The processor 111 of the channel controller 11 analyzesthe received request and obtains an LUN and a target logical blockaddress. Here, the processor 111 knows that the data is in an area to bestored in the HDD 50 (step s702). Furthermore, the processor 111 of thechannel controller 11 accesses the directory information of the writecache area and the read cache area, which is stored in the controlmemory 17, and checks whether there is the data stored in the cachememory 13 (steps s703 and s704. In the figure, accessed once. However,sometimes accessed a plurality of times in reality. This is the same inthe following). If there is already the data in cache memory 13, theprocessor 111 responds to the host computer 2 by the processing of steps715 and after. Here, the data is assumed not to be in the cache memory13. In this case, the disk controller is caused to transfer the data tothe cache memory 13 (staging). However, is there is no empty area in thecache memory 13, the cache area for storing the data needs to be createdbefore the staging. In steps s705 and s706, a determination operation isperformed on which area is used for the empty area. After the area isobtained, a staging request is made to the disk controller 14 by writinga message into a communication area 173 of the control memory 17 (steps707). The disk controller 14 knows that there is a request from thechannel controller 11 by reading the communication area 173 of thecontrol memory 17 periodically or at each completion of a series ofprocessing (steps s708 and s709). In this regard, the reason why thechannel controller 11 and the disk controller 14 operate in cooperationin such a manner is that the time required for obtaining data from theHDD 50 is indefinite and long as compared with the other processingtime. Thus, it is possible to perform the other request processing,etc., in the background in this manner. The disk controller 14, whichhas recognized a staging request, controls the HDD 50 the disk-sidechannel 60 to obtain that data (step s710). When the data from the HDD50 is obtained, the disk controller 14 writes that data into the areasobtained in steps S705 and s706 (step s711. Staging). Also, the diskcontroller 14 notifies the completion of the staging to the channelcontroller 11 using the communication area 173 (step s712). The channelcontroller 11 reads the communication area 173 in the same manner as thedisk controller 14, and thus knows that there is a message of thecompletion of the staging (steps s713 and s714). After that, theprocessor 111 of the channel controller 11 sets the transfer list 1123(may have set the list immediately after the staging request inadvance), and instructs to transfer the list. The channel protocolprocessors 114 reads the data from the cache memory 13 and transfers thedata to the host computer 2 (steps s715, s716 and s717). The abovedescription is the processing flow of the reading of the data stored inthe HDD 50. The response time of the HDD 50 is indefinite and short, andthus it becomes necessary to exchange data through the cache memory 13.

FIG. 8 is a diagram illustrating the processing flow when a read requestis made from the host computer 2 to a flash memory area. The channelcontroller 11 receives a read request from the host computer 2 throughthe channel 4 (step s801). The processor 111 of the channel controller11 analyzes the received request and obtains an LUN and a target logicalblock address. Here, the processor 111 knows that the data is in an areato be stored in the flash memory (step s802). Furthermore, the processor111 of the channel controller 11 accesses the directory information ofthe write cache area and the read cache area, which is stored in thecontrol memory 17, and checks whether there is the data stored in awrite-cache area 132 of the cache memory 13 (steps s803 and s804).Unlike the case of FIG. 7, only the investigation on the write cachearea 132 is necessary. Here, the data is assumed not to be in the cachememory 13. The processor 111 of the channel controller 11 sets thetransfer list 1123, and instructs the channel protocol processor 114 totransfer the list. The channel protocol processors 114 requests datafrom the FM control unit 16 through the connection 123 between thechannel controller and the FM control unit of the internal switch 12(step s805). The FM control unit 16 fetches data from the flash memory166 or the flash memory device 169 (step s806), and returns the data tothe channel controller 11 (step s807). The channel protocol processortransfers the data obtained in this manner to the host computer 2 (steps808). The above description is the read procedure of the data stored inthe flash memory 166 or the flash memory device 169. The reading speedof a flash memory is constant and high (step s806), and thus it becomespossible to exchange data without the cache memory 13. Also, since datais directly transferred, cache processing is not performed for reading,and thus the processing for the investigation (steps s703 and s704) of aread cache area 131 and the processing for obtaining the cache area(steps s705 and s706) become unnecessary. Therefore, it becomes possibleto read from a medium at a high speed and also to perform the attachedprocessing at a higher speed. Also, for a flash memory, the read cachearea 131 is unnecessary. Thus, there is an advantage in that it becomespossible to reduce the capacity of the control memory 17 which storesthe cache memory 13 and the read-cache directory information 1711.

Subsequently, a description will be given of a method for controlling acache memory 13 preferable for the flash memory 166 or the flash memorydevice 169. Before that, a description will be given of the informationregarding the processing flow and the cache memory 13 when a writerequest is made from the host computer 2.

FIG. 11A is a diagram illustrating the processing flow when a writerequest is made from the host computer 2 and there is already the dataof the address in the cache memory 13. For a write request, data istemporarily stored in the cache memory 13 both when the target is an HDD50 area and when the target is an flash memory area. First, the channelcontroller 11 receives a write request from the host computer 2 throughthe channel 4 (step s1101). The processor 111 of the channel controller11 analyzes the received request and obtains an LUN and a target logicalblock address (step s1102). Furthermore, the processor 111 of thechannel controller 11 accesses the directory information of the writecache area and the read cache area, which is stored in the controlmemory 17, and checks whether there is the data stored in the cachememory 13 (steps s1103 and s1104. In this regard, if there is the datain the read cache area 131, the relevant slot is invalidated by theprocedure described below and is added to new write-cache directoryinformation 1712). Here, the data of the address is assumed to bealready in the write cache area 132. In this case, the data is stored inthe same cache-memory slot (control unit of a cache memory, which willbe described below). The channel controller 11 sets the transfer list1123 to store the data into the relevant slot while requesting thetransmission of the data to the host computer 2 (step s1105). Thechannel protocol processor 114 receives data from the responded hostcomputer 2 (step s1106), and stores the data into the cache memory 13based on the transfer list 1123 (step s1107). In such a case, even ifthe request is a write request to the flash memory, the data may not bewritten into the flash memory, and thus the number of writing times canbe reduced. Accordingly, in the case of a write request, even thestorage medium of the data is the flash memory 166 or the flash memorydevice 169, processing is performed using the cache memory 13 unlike thecase of a read request.

Next, a description will be given of the processing flow of the casewhere a write request is made from the host computer 2, and there is notthe data of the address in the cache memory 13 but there is no emptyslot. The processing is the same as step s1104 in FIG. 11A as far asstep s1124. However, in this figure, it is assumed that there is not thedata of the address in the write cache area 132 and there is no emptyslot. Thus, first, the existent data in the cache memory 13 is stored inthe HDD 50 or the flash memory (destaging), and the area for storing thedata from the host computer 2 this time is created. First, the data tobe destaged is determined by an LRU (Least Recently Used) algorithm, etc(step s1125). When the data to be destaged is determined, the processor111 of the channel controller 11 sets the transfer list 1641 having thedescription of the correspondence of the address in the cache memory 13and the address of the flash memory 166 or the flash memory device 169in the FM control unit 16 (step s1127). In this regard, if the target isthe HDD 50, a destage request is performed by transmitting a message tothe disk controller 14 using the communication area 173 similarly as inFIG. 7. Subsequently, the DMA controller 162 of the FM control unit 16reads the data (steps s1127 and s1128) from the cache memory 13, andwrites the data into the flash memory 166 or the flash memory device 169(step s1129) based on the transfer list 1641. When a series ofprocessing is completed, the DMA controller 162 notifies the completionof the desatge to the processor 111 of the channel controller 11 (steps1130). In order to store this data from the host computer 2 into theslot that has been destaged, the processor 111 updates the directoryinformation (steps s1131 and s1132), and sets the transfer list 1123 soas to store the data into the relevant slot while making a transmissionrequest of the data to the host computer 2 (step s1133). The channelprotocol processor 114 of the channel controller 11 receives data fromthe responded host computer 2 (step s1134), and stores the data into thecache memory 13 based on the transfer list 1123 (step s1135).

Next, a description will be given of information on the cache memory 13described so far. FIG. 9 is a block diagram illustrating detailed datastored in a cache memory 13 and control memory 17. The cache memory 13has the read cache area 131 and the write cache area 132. The read cachearea 131 temporarily stores the data requested to be read from the hostcomputer 2. Thus, when a read request is received on the stored datafrom the host computer 2 again, the data of the read cache area 131 isreturned without reading from the HDD 50 again, thereby the speed ofprocessing as a storage system is improved. In the present embodiment,the read cache area 131 is provided because the read time from the HDD50 is indefinite and low speed. However, the read cache area 131 is notused for the data stored in the flash memory. The write cache area 132temporarily stores the data requested to be written from the hostcomputer 2. If a write request is received on the same address of thestored data, that data in the write cache area 132 is overwritten. Forthe HDD 50 area, data is temporarily written into the high-speed cachememory 13, and thus the improvement of the performance can be expected.Also, data is overwritten in the cache memory 13, and thus it ispossible to reduce the number of writing times into the flash memory. Itis therefore possible to improve the reliability and the availability ofthe storage system. In this regard, the unit for controlling these iscalled a slot here.

Next, a description will be given of the control memory 17. The controlmemory 17 stores directory information 171, configuration information172, and a communication area 173. The configuration information 172 isinformation on the storage system. For example, that information isinformation on how many channel controllers 11 are provided, what LU(Logical Unit) is provided to the channel 4 connected to each of thecontrollers, which HDD 50 or flash memory device 166 is used by the LUfor storing data, or in what form the LU is virtually provided. Thecommunication area 173 is the area for the channel controller 11 and thedisk controller 14 to write or read a message with each other in orderto perform cooperative operations. Also, the directory information 171is information indicating which data is stored in the cache memory 13.The directory information 171 has read-cache directory information 1711and write-cache directory information 1712 indicating that address datafrom the host computer 2, indicated by which LUN or logical blockaddress (LBA), etc., is stored in which part of the cache memory 13, andread and write access-sequence lists 1713 and 1714 which are used forthe bases for determining which existent data is invalidated in order tostore new data into the cache memory 13.

In this regard, the cache memory 13 and the control memory 17 include ahigh-speed volatile memory having no restriction of writing times.However, the memories include a function of backing up a battery capableof holding the contents for a certain period of time in case of powerfailure, etc. Moreover, in case of a still larger-scale power failurewhich is considered to be longer than the time period capable of holdingthe battery, all the data temporarily stored in the cache memory 13 iswritten into a medium using the processing from steps s1125 to s1129 inFIG. 11B in order not to lose data in case that the backup battery isdead. Alternatively, the images of the cache memory 13 and the controlmemory 17 are directly written into an urgent destage area provided inthe medium in advance without using this method, because the processingusing steps s1125 to s1129 needs the calculation of the processor 111.This may be executed by setting the transfer list 1641 so that all theareas of the cache memory 13 and the control memory 17 are obtained orby providing the DMA controller 162 with a function of obtaining theimages of the cache memory 13 and the control memory 17. In particular,a flash memory is a low-power-consumption device, and thus is suitablefor a medium of the processing which must be executed in a limited timeperiod and power of a backup battery. That is to say, a great advantageis obtained by providing the urgent destage area in the flash memory 166or the flash memory device 169. For example, an urgent destage area 1690is allocated to a part of the area of the flash memory device 169 inFIG. 5.

FIG. 10A is a block diagram illustrating details of the read-cachedirectory information 1711 and the write-cache directory information1172. The directory information includes an LUN field 1001, an LBA field1002, a medium field 1003 indicating the medium to which the data isfinally stored, and the subsequent correspondence list 1004 between thehost and the cache address, which stores in a list format thecorrespondence between the address (LBA) specified by the host computer2 and the address of the cache memory 13 where the data is stored. Whenan investigation on whether there is the data requested by the hostcomputer 2 in the cache memory 13 (corresponds to operations of stepss703 and s704 in FIG. 7 and steps s803 and s804 in FIG. 8, a search ismade for the data having the same LUN as the received request from theLUN field 1001. Next, an investigation is conducted on whether the LBAfield 1002 in the table indicated by the corresponding pointer matchesthe LBA of the received request. The LBA field 1002 indicates a range ofLBA, and information on the data in the matching LBA range is stored inthe correspondence list 1004 between the host and the cache addressindicated by the pointer corresponding to that field. In the list 1004,a value of LBA (not in the range) the address (slot number) of the cachestoring that data is described. If there is not a corresponding LBA inthe correspondence list 1004 between the host and the cache addressindicated, the cache memory 13 does not store the relevant data.

FIG. 10B is a block diagram illustrating details of knownaccess-sequence lists 1713 and 1714. This is information indicating whatnumber each which slot data is recently accessed. The slot stored in thebeginning is the most recently accessed slot, and the slot stored in thelast is the earliest accessed slot. The information corresponding toeach of the read cache area 131 and the write cache area 132 is storedin a list structure. For example, when an access request is receivedfrom the host computer 2 for data not stored in the cache memory 13 andan empty slot is created in the cache memory 13, assuming that a commonLRU algorithm is used, the earliest accessed slot, that is to say, theslot located at the last position of the list, is invalidated forcreating a new empty slot in the cache. After that, new data is storedin that slot, and the slot is most recently accessed. Thus, that slot isplaced at the beginning of the access-sequence lists 1713 or 1714. Forthe operation procedure of this list, first, the slot information placedat the last position is removed by a delete operation and that slotinformation is added to the beginning by an insert operation. In thisregard, at this time, the cache directory information 1711 or 1172 isupdated. The information indicating the data originally stored in thatslot is removed from the correspondence list 1004 between the host andthe cache address, and the data corresponding to a new LBA is addedalong with that slot number by the insert operation. Also, when arequest is received from the host computer 2, but the data is alreadystored in the cache memory 13, only the access-sequence lists 1713 or1714 is updated, and the cache directory information 1711 or 1172 is notupdated.

When the access-sequence list of FIG. 10B shown above is used for theflash memory 166 or the flash memory device 169, the following problemoccurs. Since the slot to be staged is determined by the accesssequence, only a certain medium is sometimes destaged, that is to say,is written. For example, when a cache memory with three slots isprovided, if a write request is made for the data having addresses A andB for FM1 and the data having addresses C and D for FM2 by a repeatingpattern A, B, C, A, B, and D, the destaging is concentrated on FM2. Insuch a situation, the number of writing times into the medium reachesthe limit number in a short time, and thus it might be difficult toprovide reliability and availability satisfactorily as a storage system.In this regard, in the present embodiment, a description is given usingan LRU algorithm. However, the same problem may occur when an algorithmother than the LRU, such as an access frequency, is used.

In the following, a description will be given of a method of controllingcache, which prevents such a problem. FIG. 10C is a block diagramillustrating details of known access-sequence lists 1713 and 1714 forperforming preferable cache control. Unlike FIG. 10B, a list 1061 isprovided for each medium (for each flash memory device 169) for a flashmemory having a restriction of the number of writing times. For the HDD50, the list may be provided for each HDD 50, or one list 1062 for allthe HDDs 50. Furthermore, each list is provided with a table having anumber-of-destage-times field 1063, a number-of-access-times field 1064,and a capacity field 1065. The number-of-destage-times field 1063indicates the total number of destages performed on the medium. Thenumber-of-access-times field 1064 indicates the number of accessesincluding reading and writing occurred on the medium area. This includesthe number of times when there is data in the cache memory 13. Also, thecapacity field 1065 indicates the capacity of the medium. The capacityfield 1065 is used when it is necessary to consider that the frequencyof writing data into one cell in the flash memory becomes lower as thecapacity becomes larger even if the flash memory device 169 is destagedby the same frequency. Furthermore, each medium has a list. The contentsof the list is almost the same as in the case of FIG. 10B. Assuming theuse of the LRU algorithm, the list stores information indicating whatnumber is which slot recently accessed. However, this information isonly on the data to be stored in this medium. In this regard, the liston the HDD 50 has a destage restriction field 1066. If this field is“none”, the cache control is performed differently on the flash memoryand the HDD 50, and the medium type is recognized as an HDD in steps1201 in FIG. 12A described below. In this case, the write cache area132 is divided into an HDD 50 area and a flash memory area in advance.When the cache memory is used more flexibly without such a division,this field is set to “existent”, and the same cache control is performedas the flash memory. In this case, even the medium type is an HDD, theprocessing as a flash memory is selected in step s1201 in FIG. 12A.Also, the number-of-destage-times field 1063 may be reset to zero atregular intervals of time. When the reset is performed, thenumber-of-destage-times field 1063 for all the media is set to zero.

Next, a description will be given of processing for determining a slotto be destaged using the access-sequence lists 1713 and 1714 in FIG. 10Cwith reference to FIG. 12A. The processing is executed by the processor111 of the channel controller 11, and corresponds to the processingafter step s1125 in FIG. 11B, which is the processing after thedestaging must be performed. First, a determination is performed on themedium type, that is to say, whether the write request received from thehost computer 2 is to the HDD or to the flash memory (step s1201). Thiscan be known using the medium field 1003 of the directory information.If the medium type is an HDD, the earliest accessed slot is searchedusing the access-sequence list 1062 of the HDD, a message for destagingthe slot is sent, and the processing is moved to step s1207 (steps1202). If the medium type is a flash memory, or if it is an HDD and thedestage restriction field 1066 is “existent”, thenumber-of-destage-times field 1063 of each medium is compared, and amedium with the smallest number of destage times is searched (steps1203). An investigation is conducted on whether there is a used slot bychecking the number of elements of the list of the medium (step s1204).If there is not a slot, a medium with the second smallest number ofdestage times is searched and the processing is moved to step s1204again (step s1205). If there is a slot, the earliest accessed slot issearched using the access-sequence list 1061 of the HDD, and aninstruction is given to destage that slot (step s1206). Next, one isadded to the number-of-destage-times field 1063 (step s1207).Furthermore, that slot is removed from the directory information andaccess-sequence list (step s1208). Moreover, information on data to bestaged is added to the latest position of the directory information andthe access-sequence list (step s1209). After that, the data receivedthis time is written into that slot (step s1210). In this regard, instep s1203, a medium with the smallest number of destage times issearched. However, as mentioned in the description of the capacity field1065, if the number of writing times of the cell itself is considered,the number of destage times divided by the capacity may be used for theevaluation function.

Also, a description will be given of the same processing inconsideration of not only the number of destage times but the number ofaccess times using FIG. 12B. First, a search is made on thenumber-of-destage-times field 1063 and the number-of-access-times field1064 of each medium. Assuming that α and β are constants, the product ofα and the number of destage times is added to the β divided by thenumber of access times, and this sum is defined as an evaluationfunction. A medium having the smallest value of the evaluation functionis searched (step s1241). By checking the number of elements in the listof the medium, an investigation is conducted on whether there is a slotin use (step s1242). If there is no slot, the medium having the nextsmallest value is searched and the processing moves to step s1242 again(step s1243). If there is a slot, the earliest accessed slot is searchedusing the access-sequence lists 1061 and 1062, and the slot isinstructed to be destaged (step s1244). The subsequent processing is thesame as step s1207 in FIG. 12A. When this processing is used, it is notnecessary to separate a flash memory area and an HDD area. Also, it ispossible to flexibly cope with a pattern in which performanceimprovement is possible using a cache memory, etc., such as the casewhere a lot of read requests are issued for the same data after a writerequest is issued when the medium is an HDD. In this regard, it ispossible to select a medium in the sequence of an index.

Second Embodiment

A description will be given of a second embodiment. FIG. 13 is a blockdiagram of a storage system according to the second embodiment of thepresent invention. In this embodiment, the FM control unit isimplemented at the position equal to the cache memory 13 and the controlmemory 15. In general, the cache memory 13 and the control memory 15 maynot be implemented at the position where the channel 4 and the disk-sidechannel 60 can be connected unlike the channel controller 11 and thedisk controller 14. There is no restriction on the implementation, forexample, there is no need for disposing the cache memory 13 and thecontrol memory 15 at the front surface of the device for easy work ofconnecting to the channel 4, and there is no need for disposing near theHDD 50 by the restriction of the transmission path of the disk-sidechannel 60. Accordingly, it is possible to implement the memories morecompactly by disposing the memories at this position. In this case, theform of the FM control unit 16 of FIG. 3 or FIG. 4 is preferable.

Furthermore, FIG. 14 shows a block diagram of a highly-functional FMcontrol unit 160, which is made more highly-functional than the FMcontrol unit 16. Moreover, when a larger scale configuration isemployed, it is preferred that this control part is used. Here, the FMcontrol unit 160 has a plurality of processors 111 in the same manner asthe channel controller 11, and a processing method is implemented by thecontrol program 1121. Thus, it is possible to perform control forobtaining high reliability and availability and for improvingmanagement.

As described in the above embodiments, according to another firstembodiment of the present invention, there is provided a storage systemincluding the storage device including a bus for directly transferringdata from a first medium controller controlling the first medium to thechannel controller.

According to another second embodiment of the present invention, thereis provided a storage system including the storage device including abus for directly transferring data from the cache memory to a firstmedium controller controlling the first medium.

According to another third embodiment of the present invention, there isprovided a storage system including the media including a first mediumhaving a restriction on a number of writing times and a second mediumhaving no restriction on the number of writing times.

According to another fourth embodiment of the present invention, thereis provided a storage system including the media, wherein the secondmedium has a lower reading speed and greater power consumption than thefirst medium, but has a by far larger possible number of writing timesthan the first medium.

According to another fifth embodiment of the present invention, there isprovided a storage system including a bus for transferring data storedin the second medium from a second medium controller controlling thesecond medium to a cache memory for temporarily storing the data.

According to another sixth embodiment of the present invention, there isprovided a storage system in which the channel controller receives aread request from the host computer, and when target data of the readrequest is not stored in the cache memory but is stored in the firstmedium, the data is directly transferred to a first medium controllercontrolling the first medium.

According to another seventh embodiment of the present invention, thereis provided a storage system in which the storage device selects data tobe destaged so as to average the number of writing times on the firstmedia.

According to another eighth embodiment of the present invention, thereis provided a storage system in which the storage device records anumber of destage times on each of the first media.

According to another ninth embodiment of the present invention, there isprovided a storage system in which the storage device compares thenumber of destage times on each of the first media when selecting datato be destaged, and determines data to be destaged from data having asmaller number of destage times with priority.

According to another tenth embodiment of the present invention, there isprovided a storage system in which the storage device recordsinformation on access time and frequency of data to be stored in each ofthe first media in relation to each of the first media.

According to another eleventh embodiment of the present invention, thereis provided a storage system in which the storage device calculates anevaluation function based on a number of destages and access times oneach of the first media, and determines data to be destaged from datahaving a smaller value of the evaluation function with priority.

According to another twelfth embodiment of the present invention, thereis provided a storage system in which the storage device includes abattery for backing up a cache memory.

According to another thirteenth embodiment of the present invention,there is provided a storage system in which the first medium controlleris a highly-functional medium controller for partially performing afunction of the channel controller.

According to another fourteenth embodiment of the present invention,there is provided a storage device including: a medium controller forcontrolling a medium for storing data from a host computer; a channelcontroller for connecting to the host computer through a channel; and acache memory including a volatile memory for temporarily storing datafrom the host computer, wherein the storage device includes a bus fordirectly transferring data from a first medium controller controllingthe first medium having a restriction on a number of writing times tothe channel controller.

According to another fifteenth embodiment of the present invention,there is provided a storage device including a bus for directlytransferring data from the cache memory to a first medium controllercontrolling the first medium.

According to another sixteenth embodiment of the present invention,there is provided a storage device further including a bus fortransferring data stored in the second medium from a second mediumcontroller controlling the second medium having a read speed slower thanthat of the first medium, power consumption greater than that of thefirst medium, and a possible number of writing times by far greater thanthat of the first medium, to a cache memory for temporarily storing thedata.

According to another seventeenth embodiment of the present invention,there is provided a storage device in which the channel controllerreceives a read request from the host computer, and when target data ofthe read request is not stored in the cache memory but stored in thefirst medium, the channel controller instructs the first mediumcontroller for controlling the first medium to directly transfer thedata.

According to another eighteenth embodiment of the present invention,there is provided a method of controlling a storage controller includinga medium controller for controlling a medium for storing data from ahost computer, a channel controller for connecting to the host computerthrough a channel, and a cache memory including a volatile memory fortemporarily storing data from the host computer, the method includingthe steps of: receiving a read request from the host computer; and whentarget data of the read request is not stored in the cache memory butstored in the first medium, instructing the first medium controller forcontrolling the first medium to directly transfer the data.

According to another nineteenth embodiment of the present invention,there is provided a method of controlling a storage controller, themethod further including selecting data to be destaged so as to averagethe number of writing times on the first media.

1. A storage system for storing data from a computer onto a medium via anetwork, comprising: a storage controller, wherein the storagecontroller comprises: a channel controller coupled to the network, acache memory that temporarily stores data related to data stored onto afirst medium and a second medium, a first medium controller, coupled tothe first medium, for controlling access to the first medium, a secondmedium controller, coupled to the second medium, for controlling accessto the second medium, a first communication path for directlytransferring data between the first medium controller and the channelcontroller, a second communication path for transferring data betweenthe cache memory and the first medium controller, or between the cachememory and the second medium controller, and a third communication pathfor transferring data between the channel controller and the cachememory, wherein the first medium is comprised of a plurality of flashmemories, and wherein the channel controller receives a read requestfrom the computer, and when target data of the read request is notstored in the cache memory but stored in the first medium, the channelcontroller instructs the first medium controller to control the firstmedium to directly transfer the target data from the first medium usingthe first communication path.
 2. The storage system according to claim1, wherein the second medium has a read speed slower than that of thefirst medium, power consumption greater than that of the first medium,and a possible number of writing times far greater than that of thefirst medium.
 3. The storage system according to claim 1, wherein thestorage controller comprises: a bus for transferring data stored in thesecond medium from a second medium controller controlling the secondmedium to a cache memory for temporarily storing the data.
 4. Thestorage system according to claim 1, wherein the storage controllerincludes a battery for backing up a cache memory.
 5. The storage systemaccording to claim 1, wherein the first medium controller is ahigh-function medium controller for partially performing a function ofthe channel controller.
 6. The storage system according to claim 1,wherein the first medium controller includes the first medium.
 7. Thestorage system according to claim 1, wherein the channel controllerperforms an analysis of a request that is received from the computer,and selects one of the first communication path or the secondcommunication path for transferring data according to a result of theanalysis.
 8. The storage system according to claim 1, wherein the secondmedium is comprised of a plurality of hard disk drives.
 9. The storagesystem according to claim 1, wherein the cache memory has read cachearea which temporarily stores the data requested to be read from thecomputer and write cache area which temporarily stores the datarequested to be written from the computer, wherein the channelcontroller checks not the read cache area but the write cache area tocheck whether there is the data stored in the cache memory, when thechannel controller receives a read request to the cache memory, andwherein the channel controller checks the write cache area and readcache area to check whether there is the data stored in the cache memorywhen the channel controller receives a read request to the secondmedium.
 10. A storage controller comprising: a channel controller to becoupled to a computer; a cache memory that temporarily stores datarelated to data stored onto a first medium and a second medium; a firstmedium controller, coupled to the first medium, for controlling accessto the first medium; a second medium controller, coupled to the secondmedium, for controlling access to the second medium; a firstcommunication path for directly transferring data between the firstmedium controller and the channel controller; a second communicationpath for transferring data between the cache memory and the first mediumcontroller, or between the cache memory and the second mediumcontroller; and a third communication path for transferring data betweenthe channel controller and the cache memory, wherein the first medium iscomprised of a plurality of flash memories, and wherein the channelcontroller receives a read request from the computer, and when targetdata of the read request is not stored in the cache memory but stored inthe first medium, the channel controller instructs the first mediumcontroller to control the first medium to directly transfer the targetdata from the first medium using the first communication path.
 11. Thestorage controller according to claim 10, wherein the second medium hasa read speed slower than that of the first medium, power consumptiongreater than that of the first medium, and a possible number of writingtimes far greater than that of the first medium.
 12. The storagecontroller according to claim 10, wherein the storage controllercomprises: a bus for transferring data stored in the second medium froma second medium controller controlling the second medium to a cachememory for temporarily storing the data.
 13. The storage controlleraccording to claim 10, wherein the storage controller includes a batteryfor backing up a cache memory.
 14. The storage controller according toclaim 10, wherein the first medium controller is a high-function mediumcontroller for partially performing a function of the channelcontroller.
 15. The storage controller according to claim 10, whereinthe first medium controller includes the first medium.
 16. The storagecontroller according to claim 10, wherein the channel controllerperforms an analysis of a request that is received from the computer,and selects one of the first communication path or the secondcommunication path for transferring data according to a result of theanalysis.
 17. The storage controller according to claim 10, wherein thesecond medium is comprises of a plurality of hard disk drives.
 18. Amethod of controlling a storage controller to store data from a computeronto a medium via a network, the storage controller including a channelcontroller coupled to the network, a cache memory that temporarilystores data related to a first medium and a second medium, a firstmedium controller, coupled to the first medium, for controlling accessto the first medium, a second medium controller, coupled to the secondmedium, for controlling access to the second medium, a firstcommunication path for directly transferring data between the firstmedium controller and the channel controller, a second communicationpath for transferring data between the cache memory and the first mediumcontroller, or between the cache memory and the second mediumcontroller, and a third communication path for transferring data betweenthe channel controller and the cache memory, said method comprising thesteps of: receiving a read request from the host computer; and whentarget data of the read request is not stored in the cache memory butstored in the first medium, instructing the first medium controller tocontrol the first medium to directly transfer the transfer data from thefirst medium using the first communication path.
 19. The method of claim18, further comprising the steps of: performing an analysis of a requestthat is received from the computer; and selecting one of the firstcommunication path or the second communication path for transferringdata according to a result of the analysis.